<template lang="html">
	<div class="vueBox" >
	    <div class="marquee">
	        <div class="marquee_title">
	            <span class="title_iocn"></span>
	        </div>
	        <div class="marquee_box">
	            <ul class="marquee_list" :style="{ top: -num + 'vw'}" :class="{marquee_top:num}">
	                <li v-for="(item, index) in gonggao" >
	                    <span>{{gonggao[index].title}}</span>
	                </li>
	            </ul>
	        </div>
	    </div>
	</div>
</template>
<script type="text/javascript">
	export default {
        props:["gonggao"],
    	data(){
    		return {
    			num:0
    		}
    	},
        created: function () {

            this.showMarquee(this.num)
        },
        methods: {
            showMarquee:function (num) {
                this.gonggao.push(this.gonggao[0]);
                var max = this.gonggao.length;
                var that = this;
                window.setInterval(function(){
                    num++;
                    if(num>=max ){
                        num=0;
                    }
                    that.num=num*12;
                }, 2000);
            }
        }
	};
</script>
<style type="text/css" lang="less">
    @import '../../../assets/less/index.less';
    .marquee{
        width: 100%;
        height: 12vw;
        align-items: center;
        display: flex;
        box-sizing: border-box;
        .marquee_title{
            padding: 0 5vw;
            height: 12vw;
            align-items: center;
            .title_iocn{
                display: inline-block;
                margin-top: 3vw;
                .icon-Notice();
            }
        }
        .marquee_box{
            display: block;
            position: relative;
            width: 80vw;
            height: 12vw;/*关键样式*/
            overflow: hidden;
            .marquee_list{
                display: block;
                position: absolute;
                top:0;
                left: 0;
            }
        }
    }

    .marquee_top{transition: top 0.5s ;}/*关键样式*/
    .marquee_list li{
        height: 12vw;/*关键样式*/
        line-height: 12vw;/*关键样式*/
        font-size: @h1_font_size;
        padding-left: 2vw;
        background-color: #fff;
    }
    .marquee_list li span{
        padding:0 2px;
    }
</style>